package com.jf.identity.service.impl;

import com.jf.identity.dao.visexamid.ExamineeDao;
import com.jf.identity.entity.ExamBaseParam;
import com.jf.identity.entity.ExamineeRelInfo;
import com.jf.identity.holder.ExamBaseParamHolder;
import com.jf.identity.service.ExamineeService;
import com.jf.identity.util.Params;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author Administrator
 */
@Service
public class ExamineeServiceImpl implements ExamineeService {
    @Resource
    private ExamineeDao examineeDao;
    @Resource
    private ExamBaseParamHolder examBaseParamHolder;
    @Override
    public ExamineeRelInfo getExamineeRelInfo() {
        ExamBaseParam examBaseParam = examBaseParamHolder.getExamBaseParam();
        examBaseParam = Params.isBlank(examBaseParam, "考试信息");
        String examId = Params.isBlank(examBaseParam.getExamId(), "考试计划");
        String examSessionNum = Params.isBlank(examBaseParam.getExamSessionNum(), "考试场次");
        Params.isBlank(examBaseParam.getOrgCode(), "机构代码");
        ExamineeRelInfo examineeRelInfo = examineeDao.getExamineeRelInfo(examBaseParam);
        if (examineeRelInfo == null) {
            examineeRelInfo = new ExamineeRelInfo();
            examineeRelInfo.setExamPlan(examId);
            examineeRelInfo.setExamSession(examSessionNum);
        }
        return examineeRelInfo;
    }
}
